package cn.xiaonhui;
import java.util.Date;
//用户信息
public class User {
	 String userName;	//用户名
	 String password;	//密码
	 Date birthday;		//生日
	 String telNumber;	//手机号码
	 String email;//邮箱
	public User(){
	}
	public User(String userName ,String password,Date birthday, String telNumber, String email){
		this.userName=userName;
		this.password =password;
		this.birthday =birthday;
		this.telNumber=telNumber;
		this.email =email;
	}
	//重写hashCode与equals方法
	public int hashCode(){
		return userName.hashCode();
	}
	public boolean equals(Object object){
		if (this ==object) {//判断是否同一个对象
			return true;
		}
		if (object ==null) {//判断对象是否为空
			return false;
		}
		if (getClass() !=object.getClass()) {//判断这个对象是否User类型
			return false;
		}
		User other =(User)object;//将对象强转为User类型
		if (userName ==null) {
			if (other.userName !=null) {
				return false;
			}
		}else if (! userName.equals(other.userName)) {
			return false;
		}{
		return true;	
		}
	}
	
}


